  layui.use(['form', 'element', 'jquery'], function() {
        var form = layui.form,
            element = layui.element,
            $ = layui.jquery;
        $('form').submit(function(event) {
            event.preventDefault();
            var ii = layer.load(2, {
                shade: [0.1, '#fff']
            });
            $.ajax({
                type: 'POST',
                url: './ajax1.php?act=updatePwd',
                data: $(this).serialize(),
                dataType: 'json',
                success: function(data) {
                    layer.close(ii);
                    if (data.code == 200) {
                        layer.alert(data.msg, {
                            icon: 1,
                            closeBtn: false
                        }, function() {
                            window.parent.location = "./login";
                        });
                    } else {
                        layer.alert(data.msg, {
                            icon: 2
                        })
                    }
                },
                error: function(data) {
                    layer.close(ii);

                    layer.msg('服务器错误');
                    return false;
                }
            });
            return false;
        });
    });